The phrase "to stretch the legs" means to take a short walk or engage in physical activity after sitting or being still for a long time.